package com.asiainfo.order.feign;

import com.asiainfo.entity.product.Product;
import com.asiainfo.order.fallcak.ProductFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 定义OpenFeign接口
 * 默认60s超时
 */
@FeignClient(value = "product-order",fallback = ProductFeignClientFallback.class,
path = "/api/product")  //需要填写微服务名称
public interface ProductFeign {

    @GetMapping("/product/{id}") //从请求路径获取参数
    public Product getProductById(@PathVariable("id") Long productId);
}
